package com.xb.loan.cashier.biz.service.channelselect;

import java.util.List;

public abstract class AbstractChannelSelector<T> implements ChannelSelector<T> {

    @Override
    public T select(List<T> channelTypes) {
        if(channelTypes==null || channelTypes.size()<1){
            return null;
        }
        if(channelTypes.size()==1){
            return channelTypes.get(0);
        }
        return doSelect(channelTypes);
    }
    
    protected abstract int getWeight(T payChannelType);
    
    protected abstract T doSelect(List<T> banks);
    
}
